package pl.lodz.p.browarex.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import pl.lodz.p.browarex.base.BaseCrudService;
import pl.lodz.p.browarex.dao.ProductDAO;
import pl.lodz.p.browarex.model.Product;
import pl.lodz.p.browarex.services.interfaces.IProductService;

@Transactional
@Repository
public class ProductService extends BaseCrudService<ProductDAO, Product, Long>
		implements IProductService {

	@Autowired
	public ProductService(ProductDAO dao) {
		super(dao);
	}

	@Override
	public Product loadByProductID(String productID) {
		return ((ProductDAO) dao).loadByProductID(productID);
	}

	@Override
	public List<Product> findProductByName(String value) {
		return ((ProductDAO) dao).findProductByName(value);
	}

	@Override
	public List<Product> findProductByManufacturer(String manufacturer) {
		return ((ProductDAO) dao).findProductByManufacture(manufacturer);
	}

}
